package com.mingqi.enetconnected.primary.mytask.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.widget.TextView;

import com.mingqi.enetconnected.base.BaseFragment;

import java.util.List;

/**
 * Created by li on 2018/8/13.
 * WeChat 18571658038
 * author LiWei
 */

public class TaskTypePagerAdapter extends FragmentPagerAdapter {

    private List<TextView> mTextViews;
    private List<BaseFragment> mFragments;

    public TaskTypePagerAdapter(FragmentManager fm, List<TextView> textViews, List<BaseFragment> fragments) {
        super(fm);
        mTextViews = textViews;
        mFragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {

        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTextViews.get(position).getText();
    }
}
